// import { request } from 'http'
// import { title } from 'process'
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
import { createRouter, createWebHistory } from 'vue-router'
export const routes= [
  {path:"/login/list",
    name:"login/list",
    component:()=>import("@/views/login/index2.vue"),
  },
    {path:"/",
      name:"home",
      redirect:"/home",
      meta:{requestAuth:true,title:"首页"},
      component:()=>import("@/layout/index.vue"),
      children:[
        {path:"/home",
             meta:{requestAuth:true,title:"首页"},
          component:()=>import("@/views/home/index.vue")
        }
      ]
    },
    {path:"/login",
      name:"login",
      component:()=>import("@/views/login/index.vue")
    },
    {path:"/account",
      name:"account",
      redirect:"/account/admin",
         meta:{requestAuth:true,title:"账户列表"},
      component:()=>import("@/layout/index.vue"),
      children:[
        {path:"/account/admin",
          meta:{requestAuth:true,title:"管理员列表"},
          component:()=>import("@/views/account/MyAdmin.vue")
        },
        {path:"/account/user",
          meta:{requestAuth:true,title:"用户列表"},
          component:()=>import("@/views/account/MyUser.vue")
        }
      ]
    },
    {path:"/banner",
      name:"banner",
      redirect:"/banner/list",
      meta:{requestAuth:true,title:"轮播图管理"},
      component:()=>import("@/layout/index.vue"),
      children:[
        {path:"/banner/list",
          meta:{requestAuth:true,title:"轮播图列表"},
          redirect:"/banner/list/home",
          component:()=>import("@/views/banner/index.vue"),
          children:[
            {path:"/banner/list/home",
              meta:{requestAuth:true,title:"首页轮播图列表"},
              component:()=>import("@/views/banner/component/BannerList.vue")
            },
            {path:"/banner/list/kind",
              meta:{requestAuth:true,title:"分类轮播图列表"},
              component:()=>import("@/views/banner/component/BannerKind.vue")
            }
          ]

        }
      ]
    },
    {path:"/pro",
      name:"pro",
      redirect:"/pro/list",
      meta:{requestAuth:true,title:"产品管理"},
      component:()=>import("@/layout/index.vue"),
      children:[
        {path:"/pro/list",
             meta:{requestAuth:true,title:"产品列表"},
          component:()=>import("@/views/pro/index.vue")
        },
        {path:"/pro/filter",
             meta:{requestAuth:true,title:"筛选列表"},
          component:()=>import("@/views/pro/filter.vue")
        }
      ]
    }
  ]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
